<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<jsp:useBean id="member" class="com.kamikaze.Member" scope="session" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<sql:query var="rs" dataSource="jdbc/j2db">
SELECT users.user_id
	,  users.user_name
	,  users.user_gender
	,  users.user_birthday
	,  users.user_tel
	,  users.user_mobile
	,  users.user_address
	,  users.user_salary
	,  depts.dept_name
	,  userlevel.level_name
FROM users
   , depts
   , userlevel 
where users.dept_number = depts.dept_number 
	  and 
	  users.user_level = userlevel.user_level
	  and
	  users.user_id = ?
	  <sql:param>${member.user_id}</sql:param>
</sql:query>
<form action="mod" method="post">
<table align="center">
<caption><h1>修改個人資料</h1></caption>
<hr>
	<tr>
		<th>員工編號</th>
		<th>姓名</th>
		<th>性別</th>
		<th>生日</th>
		<th>家用電話</th>
		<th>行動電話</th>
		<th>地址</th>
		<th>所屬部門</th>
		<th>職稱</th>
	</tr>
	<c:forEach var="r" items="${rs.rows }">
		<tr>
			<td>${r.user_id }<input type="hidden" name="user_id" value="${r.user_id }" /></td>
			<td>${r.user_name }</td>
			<td>${r.user_gender }</td>
			<td>${r.user_birthday }</td>
			<form action="mod" method="post">
			<td><input type="text" name="user_tel" value="${r.user_tel }" /></td>
			<td><input type="text" name="user_mobile" value="${r.user_mobile }" /></td>
			<td><input type="text" name="user_address" value="${r.user_address }" /></td>
			<td>${r.dept_name }</td>
			<td>${r.level_name }</td>
		</tr>
	</c:forEach>
</table>
<br>
<input type="submit" value="修改資料" />
</form>